package org.example.myleet.p867;

public class Solution1 {

    /**
     * 0 ms
     * 转置，行变列，列变行
     */
    public int[][] transpose(int[][] matrix) {
        int m = matrix.length, n = matrix[0].length;
        int[][] transposed = new int[n][m];
        for (int i=0; i<m; i++) {
            for (int j=0; j<n; j++) {
                transposed[j][i] = matrix[i][j];
            }
        }
        return transposed;
    }
}
